<template>
    <div class="xunjingwendao">
        <Navbar />

        <div class="main container">

            <div class="center">

                <div class="full-screen-iframe-container">
                    <iframe v-loading="loading" :src="iframeSrc" frameborder="0" class="full-screen-iframe"></iframe>
                </div>
                <div class="cl"></div>
            </div>



            <div class="cl"></div>
            <Footer />
        </div>

    </div>

</template>

<script>

export default {
    name: 'FullScreenIframe',
    data() {
        return {
            loading: false,
            iframeSrc: 'https://www.xjwd.net:9502/show.html?act=ok', // 替换为你想要显示的URL
            arrangeEightFormData: null
        };
    },
    mounted() {

        const arrangeEightFormStorage = JSON.parse(localStorage.getItem('arrangeEightFormStorage'))
        this.arrangeEightFormData = arrangeEightFormStorage;

        let ztysBool = arrangeEightFormStorage.ztys;
        let name = `&name=${arrangeEightFormStorage.name}`;
        let DateType = '&DateType=5';
        let inputdate = `&inputdate=${arrangeEightFormStorage.birthday}`;
        let sex = `&sex=${arrangeEightFormStorage.sex}`;
        let leixinggg = '&leixinggg=on';
        let ztys = `&ztys=${arrangeEightFormStorage.ztys}`
        let sect = `&Sect=${arrangeEightFormStorage.Sect}`
        let siling = `&Siling=${arrangeEightFormStorage.Siling}`;
        let sylx = '&SYLX=bzpp';
        let bazi = '&ng=己卯&yg=庚午&rg=庚寅&sg=丁丑'
        let token = `&token=${localStorage.getItem('token')}`
        let city1 = '&city1=',
            city2 = '&city2=',
            city3 = '&city3=';

        if (ztysBool == 1) {
            let cityArr = arrangeEightFormStorage.cityFull.split('/');
            city1 += cityArr[0];
            city2 += cityArr[1];
            city3 += cityArr[2];
        } else {
            city1 += '北京';
            city2 += '北京';
            city3 += '东城区';
        }


        let urlAll = this.iframeSrc + name + DateType + inputdate + bazi + sex + ztys + sect + siling + sylx + token;
        if (ztysBool) {
            urlAll += city1 + city2 + city3;
        }

        this.iframeSrc = urlAll; // 更新URL
        this.loading = true;


    },
};
</script>

<style scoped>
.full-screen-iframe-container {
    position: relative;
    width: 100%;
    height: 100vh;
    /* 使用视口高度 */
    overflow: hidden;
}

.full-screen-iframe {
    width: 100%;
    height: 100%;
    border: none;
}
</style>